
///////////////////////////////////////////////////////////
//  Senate Models for paper and appendix (JOP R&R)       //
///////////////////////////////////////////////////////////

*Use "HarbridgeYong_Volden_Wiseman_Senate_Replication" Stata Dataset for following .do file

* For FIXED EFFECTS BY MEMBER
xtset icpsr

* Table 1 
* Model 1.4: No controls
xtreg les mean_prop_cospon_opp_spon_SN, fe cluster(icpsr)
* Model 1.5: With standard control variables
xtreg les mean_prop_cospon_opp_spon_SN seniority majority maj_leader min_leader chair subchr power meddist female afam latino deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN, fe cluster(icpsr)
* Model 1.6: But being a bipartisan cosponsor does not help (directly) 
xtreg les mean_prop_cospon_opp_spon_SN prop_co_bipart seniority majority maj_leader min_leader chair subchr power meddist female afam latino deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN, fe cluster(icpsr)

* TABLE 2: Robustness to evolving conditions across Congresses
* Model 2.4 (interactions with linear time trend)
xtreg les c.mean_prop_cospon_opp_spon_SN##c.time prop_co_bipart seniority majority maj_leader min_leader chair subchr power meddist female afam latino deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN, fe cluster(icpsr)
* Model 2.5 (interaction with majority seat margin)
xtreg les c.mean_prop_cospon_opp_spon_SN##c.majmargin prop_co_bipart seniority majority maj_leader min_leader chair subchr power meddist female afam latino deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN, fe cluster(icpsr)
* Model 2.6 (interaction with polarization, difference in party medians)
xtreg les c.mean_prop_cospon_opp_spon_SN##c.normptydiff prop_co_bipart seniority majority maj_leader min_leader chair subchr power meddist female afam latino deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN, fe cluster(icpsr)

* Table 3
* Model 3.4
xtreg les mean_prop_cospon_opp_spon_SN bipart_sq seniority majority maj_leader min_leader chair subchr power meddist deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN, fe cluster(icpsr)
* Model 3.5 (majority party)
xtreg les mean_prop_cospon_opp_spon_SN bipart_sq seniority majority maj_leader min_leader chair subchr power meddist deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN if majority==1, fe cluster(icpsr)
* Model 3.6 (minority party)
xtreg les mean_prop_cospon_opp_spon_SN bipart_sq seniority min_leader power meddist deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN if majority==0, fe cluster(icpsr)

* Table 4 
* Model 4.3: No fixed effects in Senate
reg mean_prop_cospon_opp_spon_SN prop_co_bipart seniority majority maj_leader min_leader chair subchr power meddist female afam latino deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN, cluster(icpsr)
* Model 4.4: With Fixed Effects in Senate
xtreg mean_prop_cospon_opp_spon_SN prop_co_bipart seniority majority maj_leader min_leader chair subchr power meddist deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN, fe cluster(icpsr)

* For Figure A3 (labels and details added with PowerPoint and Word)
reg mean_prop_cospon_opp_spon_SN prop_co_bipart seniority majority maj_leader min_leader chair subchr power meddist female afam latino deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN, cluster(icpsr)
quietly margins, atmeans at(meddist=(0(0.01)1) prop_co_bipart=(0(0.25)0.5))
marginsplot, x(meddist) scheme(s1manual) recast(line) recastci(rarea) ytitle("Proportion Bipartisan Cosponsors Attracted", size(medium)) xtitle("Distance from Median", size(medium)) title("", size(large)) plotregion(style(none))

* For descriptive statistics Appendix Table A1
sum les mean_prop_cospon_opp_spon_SN prop_co_bipart mean_cospon_spon_SN seniority majority maj_leader min_leader chair subchr power meddist female afam latino deleg_size votepct votepct_sq up_for_reelection majmargin if mean_prop_cospon_opp_spon_SN~=.

* Appendix Table A2
* Model A2.4: No controls
xtreg les mean_prop_cospon_opp_spon_SN_nc, fe cluster(icpsr)
* Model A2.5: With standard control variables
xtreg les mean_prop_cospon_opp_spon_SN_nc seniority majority maj_leader min_leader chair subchr power meddist female afam latino deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN, fe cluster(icpsr)
* Model A2.6: But being a bipartisan cosponsor does not help (directly) 
xtreg les mean_prop_cospon_opp_spon_SN_nc prop_co_bipart_nc seniority majority maj_leader min_leader chair subchr power meddist female afam latino deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN_nc, fe cluster(icpsr)

* Appendix Table A3
* Model A3.4: No controls
xtreg les normbipart, fe cluster(icpsr)
* Model A3.5: With standard control variables
xtreg les normbipart seniority majority maj_leader min_leader chair subchr power meddist female afam latino deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN, fe cluster(icpsr)
* Model A3.6: But being a bipartisan cosponsor does not help (directly) 
xtreg les normbipart prop_co_bipart seniority majority maj_leader min_leader chair subchr power meddist female afam latino deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN, fe cluster(icpsr)

* Appendix Table A4
* Model A4.4 
xtreg les mean_prop_cospon_opp_spon_SN prop_spon_no_cospon seniority majority maj_leader min_leader chair subchr power meddist female afam latino deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN, fe cluster(icpsr)
* Model A4.5
xtreg les mean_prop_cospon_opp_spon_SN seniority majority maj_leader min_leader chair subchr power meddist deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN if congress>99, fe cluster(icpsr)

* Appendix Table A5
* Model A5.3 
xtreg les prop_spon_bi_cospon seniority majority maj_leader min_leader chair subchr power meddist female afam latino deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN, fe cluster(icpsr)
* Model A5.4
xtreg les prop_spon_bi_cospon_all seniority majority maj_leader min_leader chair subchr power meddist female afam latino deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN, fe cluster(icpsr)

* Appendix Table A6
* Model A6.4
reg les mean_prop_cospon_opp_spon_SN, cluster(icpsr)
* Model A6.5
reg les mean_prop_cospon_opp_spon_SN seniority majority maj_leader min_leader chair subchr power meddist female afam latino deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN, cluster(icpsr)
* Model A6.6
reg les mean_prop_cospon_opp_spon_SN prop_co_bipart seniority majority maj_leader min_leader chair subchr power meddist female afam latino deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN, cluster(icpsr)

* Appendix Table A7
* For Model A7.2 
xtreg les c.mean_prop_cospon_opp_spon_SN##c.normvotepct prop_co_bipart seniority majority maj_leader min_leader chair subchr power meddist female afam latino deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN, fe cluster(icpsr)
* For Model A7.3 (interacting with whether Senator is up for reelection this cycle)
xtreg les c.mean_prop_cospon_opp_spon_SN##i.up_for_reelection prop_co_bipart seniority majority maj_leader min_leader chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_SN, fe cluster(icpsr)

* Appendix Table A9
* Model A9.1: Gaining bipartisan cosponsors somewhat improves introductions
xtreg allbill mean_prop_cospon_opp_spon_SN seniority majority maj_leader min_leader chair subchr power meddist female afam latino deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN, fe cluster(icpsr)
* Model A9.2: Action in committee
xtreg allaic mean_prop_cospon_opp_spon_SN seniority majority maj_leader min_leader chair subchr power meddist female afam latino deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN, fe cluster(icpsr)
* Model A9.3: Does affect percent reaching floor
xtreg allabc mean_prop_cospon_opp_spon_SN seniority majority maj_leader min_leader chair subchr power meddist female afam latino deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN, fe cluster(icpsr)
* Model A9.4: Pass the Senate
xtreg allpass mean_prop_cospon_opp_spon_SN seniority majority maj_leader min_leader chair subchr power meddist female afam latino deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN, fe cluster(icpsr)
* Model A9.5: Does substantially increase law production
xtreg alllaw mean_prop_cospon_opp_spon_SN seniority majority maj_leader min_leader chair subchr power meddist female afam latino deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN, fe cluster(icpsr)

* Appendix Table A10
* Model A10.4
xtreg alllaw mean_prop_cospon_opp_spon_SN bipart_sq seniority majority maj_leader min_leader chair subchr power meddist female afam latino deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN, fe cluster(icpsr)
* Model A10.5
xtreg nonclaw mean_prop_cospon_opp_spon_SN bipart_sq seniority majority maj_leader min_leader chair subchr power meddist female afam latino deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN, fe cluster(icpsr)
* Model A10.6
xtreg sslaw mean_prop_cospon_opp_spon_SN bipart_sq seniority majority maj_leader min_leader chair subchr power meddist female afam latino deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN, fe cluster(icpsr)

* Appendix Table A13 
* For Model A13.1 (linear early)
xtreg les mean_prop_cospon_opp_spon_SN seniority majority maj_leader min_leader chair subchr power meddist deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN if congress<104, fe cluster(icpsr)
* For Model A13.2 (nonlinear early)
xtreg les mean_prop_cospon_opp_spon_SN bipart_sq seniority majority maj_leader min_leader chair subchr power meddist deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN if congress<104, fe cluster(icpsr)
* For Model A13.3 (linear later)
xtreg les mean_prop_cospon_opp_spon_SN seniority majority maj_leader min_leader chair subchr power meddist deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN if congress>103, fe cluster(icpsr)
* For Model A13.4 (nonlinear later)
xtreg les mean_prop_cospon_opp_spon_SN bipart_sq seniority majority maj_leader min_leader chair subchr power meddist deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN if congress>103, fe cluster(icpsr)

* Appendix Table A14
* Model A14.3: No fixed effects in Senate
reg mean_prop_cospon_opp_spon_SN_nc prop_co_bipart_nc seniority majority maj_leader min_leader chair subchr power meddist female afam latino deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN_nc, cluster(icpsr)
* Model A14.4: With Fixed Effects in Senate
xtreg mean_prop_cospon_opp_spon_SN_nc prop_co_bipart_nc seniority majority maj_leader min_leader chair subchr power meddist deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN_nc, fe cluster(icpsr)

* Appendix Table A15
* Model A15.3: majority party
xtreg mean_prop_cospon_opp_spon_SN prop_co_bipart seniority majority maj_leader min_leader chair subchr power meddist deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN if majority==1, fe cluster(icpsr)
* Model A15.4: minority party
xtreg mean_prop_cospon_opp_spon_SN prop_co_bipart seniority  min_leader power meddist deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN if majority==0, fe cluster(icpsr)

* Table A16 
* Model A16.3: early
xtreg mean_prop_cospon_opp_spon_SN prop_co_bipart seniority majority maj_leader min_leader chair subchr power meddist deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN if congress<104, fe cluster(icpsr)
* Model A16.4: later
xtreg mean_prop_cospon_opp_spon_SN prop_co_bipart seniority majority maj_leader min_leader chair subchr power meddist deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN if congress>103, fe cluster(icpsr)


*** ANALYSES FOR FOOTNOTES

* For footnote on main findings for Democrats and Republicans
xtreg les mean_prop_cospon_opp_spon_SN seniority majority maj_leader min_leader chair subchr power meddist female afam latino deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN if dem==1, fe cluster(icpsr)
xtreg les mean_prop_cospon_opp_spon_SN seniority majority maj_leader min_leader chair subchr power meddist female afam latino deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN if dem==0, fe cluster(icpsr)

*For footnote that additional appendix stages results hold without fixed effects
reg allbill mean_prop_cospon_opp_spon_SN mean_cospon_spon_SN seniority majority maj_leader min_leader chair subchr power meddist female afam latino deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN, cluster(icpsr)
reg allaic mean_prop_cospon_opp_spon_SN mean_cospon_spon_SN seniority majority maj_leader min_leader chair subchr power meddist female afam latino deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN, cluster(icpsr)
reg allabc mean_prop_cospon_opp_spon_SN mean_cospon_spon_SN seniority majority maj_leader min_leader chair subchr power meddist female afam latino deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN, cluster(icpsr)
reg allpass mean_prop_cospon_opp_spon_SN mean_cospon_spon_SN seniority majority maj_leader min_leader chair subchr power meddist female afam latino deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN, cluster(icpsr)
reg alllaw mean_prop_cospon_opp_spon_SN mean_cospon_spon_SN seniority majority maj_leader min_leader chair subchr power meddist female afam latino deleg_size votepct votepct_sq up_for_reelection mean_cospon_spon_SN, cluster(icpsr)
